<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.*"%>

<html:html locale="true">
<head>
<title>index page</title>
<html:base/>
<style type="text/css">
      
      
A:active { COLOR: green; TEXT-DECORATION: none } 
A:hover { COLOR: red; TEXT-DECORATION: none; font-weight: none }

</style>

<SCRIPT language=javascript>
<!--

function validate(formObj){
	if(formObj.address.value.length==0){
		alert("Please enter your address!");
		formObj.address.focus();
		return false;
   }

   formObj.actionUpdateData.value="update";
   return true;
}
//-->expirationDate 
</SCRIPT>

</head>

<body>

<%@ include file="../top.jsp"%>  
<c:set var="total" value="${0}"/>
<table align="center" width="100%">	
	<tr>
		<td valign="top" align="center">
			 <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#6699CC" >
				<tr bgcolor="white">
					<td align="center" width="75%"><br>
					 <html:form  method="post" action="/user/checkout" onsubmit="return validate(this)">							
							<html:hidden property="action"/>
							<html:hidden property="actionUpdateData"/>
							<table bgcolor="#6699CC" border="0" cellpadding="2" cellspacing="1" align="center" width="70%">
								<tbody>
								<tr bgcolor="#6699CC">
								<td align="center"colspan="2" ><b><font color="white">Checkout</font></b></td>
								</tr>
								<tr bgcolor="#ffffff">
								<td colspan="2"><br><font color="red">Payment details</font><hr color="#6699CC"></td>
								</tr>

								<tr bgcolor="#ffffff">
								<td colspan="2">
								<table cellSpacing="1" cellPadding="5" width="100%">
										  <tbody>
											<tr bgcolor="#E1E1E1">
											  <td width="15%"><b>Quantity</b></td>											
											  <td width="65%"><b>Title</b></td>						  
											</tr>

											 <c:forEach var="result" items="${cartItems}">
												<tr>
												  <td><c:out value="${result.qty}"/></td>
												 
												  <td><c:out value="${result.itemName}"/></td>									 
												</tr>
											</c:forEach>
										</tbody>
										</table>
									</td>
								</tr>
								<tr bgcolor="#ffffff">
									<td colspan="2"><br><font color="red">Personal information</font><hr color="#6699CC"></td>
								</tr>
								<tr bgcolor="#ffffff">
									<td><b><font color="#FF0000">*</font>Name:</b></td>
									<td><html:text property="firstName" size="30"/></td>
								</tr>
								<tr bgcolor="#ffffff">
									<td><b><font color="#FF0000">*</font>Address:(billing & shipping)</b></td>
									<td><html:textarea  rows="5" cols="23" property="address"></html:textarea></td>
								</tr>													
								<tr>
									<td><html:submit>Place Order</html:submit></td>
								</tr>
								</tbody>
							</table>

					</html:form>
				</td>	 </tr>          
</table>

</body>
</html:html>